package tw.com.hitevision.whiteboard.android.display


import android.os.Process


/**
 * @name wcd_floatbar
 * @author Realmo
 * @email   momo.weiye@gmail.com
 * @version 1.0.0
 * @time 2019/1/19 13:03
 * @describe
 */
object RectTouchCommandUtil {


    /**
     * 初始区域触控
     *
     * @param topLeftX
     * @param topLeftY
     * @param width
     * @param height
     * @return id
     */
    fun getInitSourceDisableRectTouchCMD(topLeftX: Int, topLeftY: Int, width: Int, height: Int): String {

        val rectCMD = String.format("ReqUsbControl 3 (%d,%d,%d,%d)",
                topLeftX, topLeftY, width, height)

//        DefaultLogger.debug("init rect cmd====:$rectCMD")
        return rectCMD

    }

    /**
     * 重置区域触控
     *
     * @param id
     * @param topLeftX
     * @param topLeftY
     * @param width
     * @param height
     */
    fun getResetSourceDisableRectTouchCMD(id: Int, topLeftX: Int, topLeftY: Int, width: Int, height: Int): String {
        val rectCMD = String.format("ReqUsbControl 4  %d (%d,%d,%d,%d) %d",
                id, topLeftX, topLeftY, width, height, Process.myPid())

//        DefaultLogger.debug("set rect cmd====:$rectCMD")

        return rectCMD


    }


    /**
     * 取消区域触控
     *
     * @param id
     */
    fun getCancelSourceDisableRectTouchCMD(id: Int): String {

        val rectCMD = String.format("ReqUsbControl 5  %d", id)

//        DefaultLogger.debug("cancel rect cmd====:$rectCMD")

        return rectCMD


    }


    fun getSourceDisableTouchCMD(): String {

        val rectCMD = String.format("ReqUsbControl 2 %d", Process.myPid())
//        DefaultLogger.debug("disable touch cmd====:$rectCMD")

        return rectCMD

    }

    fun getSourceEnableTouchCMD(): String {

        val rectCMD = String.format("ReqUsbControl 1 %d", Process.myPid())
//        DefaultLogger.debug("enalbe touch cmd====:$rectCMD")

        return rectCMD

    }

}